<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // let r = fetch('/bar');
    // console.log(r); // Promise <pending>
    // let r = fetch('/bar');
    // r.then((resonse)=>{
    //     console.log(response);
    // }).catch((err)=>{
    //     console.log(err+err.message);
    // })
    fetch('/bar').then((response) => {
        return response.text()
    }).then((res) => {
        console.log(res);
    }).catch(err => {
        console.log(err);
    })
</script>

</html>